package com.hbnu.service.impl;
import com.hbnu.dao.OrderMapper;
import com.hbnu.pojo.Order;
import com.hbnu.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class OrderServiceImpl implements OrderService{
    @Autowired
    private OrderMapper orderMapper;

    //1.查询所有订单信息
    @Override
    public List<Order> findAll() {
        return orderMapper.findAll();
    }

    //2.新增订单信息
    @Override
    public void addOrder(Order order) {
        orderMapper.addOrder(order);
    }

    //3.根据id删除指定的订单信息
    @Override
    public void deleteById(Integer id) {
        orderMapper.deleteById(id);
    }

    // 4.根据id查询订单信息
    @Override
    public Order findById(Integer id) {
        return orderMapper.findById(id);
    }

    // 5.根据id更新订单信息
    @Override
    public void updateById(Order order) {
        orderMapper.updateById(order);
    }

}
